cc.Class({
    extends: cc.Component,

    properties: {
        gray:{
            default: null,
            type:cc.SpriteFrame
        },
        num:0
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    // start () {
    //     this.setClear();
    // },

    // update (dt) {},

    setCurrent() {
        this.getComponent(cc.Sprite).spriteFrame = this.gray;
        this.getComponent(cc.Button).enabled = false;
        if (this.num<10) {
            this.node.width = this.node.height = 37;
            this.node.children[0].getComponent(cc.Label).string = this.num;
            this.node.children[0].active = true;
        }
    },
    setClear() {
        this.getComponent(cc.Sprite).spriteFrame = this.gray;
        cc.log(this.num);
        if (this.num<10) {
            this.node.width = this.node.height = 17;
        }
    },
    onClick() {
        cc.director.loadScene("scene"+this.num);
    }
});
